/**
 * Author xiaol
 * Rev
 * Date: 2021-03-25 21:13
 * <p>
 * Copyright (C) 2021 Seeyon, Inc. All rights reserved.
 * <p>
 * This software is the proprietary information of Seeyon, Inc.
 * Use is subject to license terms.
 * @company seeyon.com
 * @author xiaol
 */
package com.lagou.dao;

import com.lagou.annotate.Service;
import com.lagou.datasource.DataSourceConfig;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * @description
 * @date 2021-03-25 21:13
 * @author xiaol
 */
@Service
public class PayDaoImpl implements PayDao{


	@Override
	public void addPay() throws SQLException {
		Connection connection = DataSourceConfig.getConnection();
		PreparedStatement preparedStatement = connection.prepareStatement("update user set money = money + 100 where id = 1");
		preparedStatement.executeUpdate();
	}

	@Override
	public void deletePay() throws SQLException {
		Connection connection = DataSourceConfig.getConnection();
		PreparedStatement preparedStatement = connection.prepareStatement("update user set money = money - 100 where id = 1");
		preparedStatement.executeUpdate();
	}
}
